package com.example.mapper;

import com.example.entity.Advertisement;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

// AdvertisementMapper.java
public interface AdvertisementMapper {
    @Select("SELECT * FROM advertisement ORDER BY id DESC LIMIT 1")
    Advertisement selectLatest();

    @Update("UPDATE advertisement SET content=#{content}, image_url=#{imageUrl} WHERE id=#{id}")
    int update(Advertisement ad);
}
